package com.spotalog.server.service;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import com.google.common.base.Optional;
import com.spotalog.shared.exceptions.NotFoundException;

public interface Service<T> {
	T upsert(@NotNull T entity);

	T readSafe(@Min(1) long id) throws NotFoundException;

	Optional<T> read(@Min(1) long id);

	void delete(@Min(1) long id);
}